<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style>
        .outer {
            width: 500px;
            background-color: skyblue;
            border: 1px solid black;
        }

        .box {
            width: 100px;
            height: 100px;
        }

        .box1 {
            background-color: red;
            /*开启定位*/
            position: relative;
            /*具体顶部*/
            top: 10px;
            /*距离左边*/
            left: 40px;
        }

        .box2 {
            background-color: blue;
            /*
            “position: relative”：使用此属性说明已经开启相对定位
            */
            position: relative;
            /*
            相对的是本元素原来的位置，不是浏览器边缘也不是父容器边缘
            */
            left: 200px;
        }

        .box3 {
            background-color: green;
        }
    </style>
</head>
<body>
<div class="outer">
    <div class="box box1">1</div>
    <div class="box box2">2</div>
    <div class="box box3">3</div>
</div>
</body>
</html>